import request from '@/utils/request'
import qs from 'qs'

export function fetchList(query) {
  return request({
    url: '/audits',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/audit',
    method: 'get',
    params: { id }
  })
}
export function getStreet() {
  return request({
    url: '/type',
    method: 'get'
  })
}

export function addArticle(data) {
  return request({
    url: '/audit',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function deleteArticle(id) {
  return request({
    url: '/audit',
    method: 'delete',
    params: { id }
  })
}

export function updateArticle(data) {
  return request({
    url: `/audit`,
    method: 'put',
    data: qs.stringify(data)
  })
}

export function resetArticle(id) {
  return request({
    url: `/password`,
    method: 'put',
    params: { id }
  })
}

